Affinity
This crate provides a consistent way to set core affinity for currently running threads and processes.
Usage
use *;
Complete example here.
Features
- Bind to multiple cores
- Return list of currently bound cores
- Reliably get number of cores (uses num_cpus)
- Allow caller to handle errors
- Supports affinity inheritance for new child processes on Windows (through
set_process_affinity()
)
Platforms
Currently only tested on :
- Windows
- Linux (Arch x64)
License
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.